<form action="<?php echo U('Admin/Member/Index/create');?>" id="create-member" class="_ajaxSubmit" method="post">
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">用户名<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input name="username" type="text" autocomplete="off" class="form-control radius-none _data" >
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">用户密码<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input name="password" type="text" autocomplete="off" class="form-control radius-none _data">
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">手机号码<pub>*</pub> :</div>

        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <div class="input-group">
                <input name="mobile" type="number" autocomplete="off" class="form-control radius-none _data" >
                    <span class="input-group-btn">
                        <button id="getCode" class="btn btn-default radius-none" type="button">获取验证码</button>
                    </span>
            </div>
        </div>

    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">验证码<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input name="mobile_code" type="text" autocomplete="off" class="form-control radius-none _data" >
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">用户昵称 :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input name="nicname" type="text" autocomplete="off" class="form-control radius-none _data" >
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists hidden">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">邀请码 :</div>
        <div class="col-lg-1 col-md-2 col-xs-3 filed-from padding-none">
            <input name="invitation" type="text" autocomplete="off" class="form-control radius-none _data" >
        </div>
    </div>
    <div class="col-xs-12 col-md-12 col-lg-12 lists text-right">
        <input type="submit" name="dosubmit" value="保存" class="btn btn-success radius-none">
        <input type="reset"  value="重置" class="btn btn-info radius-none">
    </div>
</form>
<script>
    $(function(){

        //获取手机验证码
        $('#getCode').unbind('click');
        $('#getCode').click(function(){

            var mobile = $('input[name="mobile"]').val();
            if(mobile == '')
            {
                layer.msg('手机号码不能为空',function(){});
                return false;
            }

            layer.load();

            $.post('<?php echo U("App/Sms/Mobile/code")?>',{'mobile':mobile},function(result){

                layer.closeAll();

                var result = JSON.parse(result)

                if(result.code == 200){

                    layer.msg(result.msg);

                }else{

                    layer.msg(result.msg,function(){});

                }

            });

        })
//        $('input[type="checkbox"]','._ajaxSubmit').unbind('click');
//        $('input[type="checkbox"]','._ajaxSubmit').click(function(){
//
//            var ids = '';
//
//            $('input[type="checkbox"]:checked','._ajaxSubmit').each(function(i,v){
//
//                ids += $(this).val()+',';
//
//            });
//
//            ids = ids.substring(0,(ids.length -1));
//
//            $('input[name="group"]').val(ids);
//
//        });
//
    });

    //数据提交回调
    function ajaxRequestCallback(result,id,_this){

        if(result.code == 200){

            layer.msg(result.msg);

        }else{

            layer.msg(result.msg,function(){});

        }

    }
</script>